package com.woniu.listener;

import com.woniu.service.IQQUserService;
import lombok.extern.log4j.Log4j2;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.Executors;

/**
 * 监听SpringBoot启动,然后创建线程池
 */
@Configuration
@Log4j2
public class ApplicationLisener implements CommandLineRunner {


    @Override
    public void run(String... args) throws Exception {
        System.out.println("容器启动了，监听到了。。。");
        IQQUserService.service = Executors.newCachedThreadPool();
        log.debug("线程池加载成功.....");
    }
}
